<template>
  <div>
    <Navmenu></Navmenu>
    <el-container>
      <IndexMenu @indexSelect="listByCategory" ref="sideMenu"></IndexMenu>
      <el-main>
        <el-row>
          <el-col :span="8" v-for="(o, index) in messagelist" :key="o" :offset="index > 0 ? 2 : 2">
            <el-card :body-style="{ padding: '0px' }">
              <div style="padding: 14px;">
                <el-container>
                  <el-el-aside width="100" height="300">
                    <img src="https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png" class="image" style="width: 100px "height="200px">
                  </el-el-aside>
                  <el-main>
                    <el-container>
                      <el-header>
                        <div style="font-size: 30px">
                          教师信息
                        </div>

                      </el-header>
                      <el-header >
                        <div style="float: left" >
                          姓名： {{ o.teahername }}
                        </div>
                      </el-header>
                      <el-header>
                        <div style="float: left">
                          毕业院校： {{o.school}}
                        </div>
                      </el-header>
                      <el-main>
                        <div style="float: left">
                          简介： {{ o.tinfo}}
                        </div>

                      </el-main>
                    </el-container>
                  </el-main>
                </el-container>
              </div>
            </el-card>
          </el-col>
        </el-row>

      </el-main>

    </el-container>
  </div>
</template>

<script>
    import NavMenu from "./common/NavMenu";
    import IndexMenu from "./IndexMenu";
    export default {
        name: "TeacherSchoolMessage",
      components: {IndexMenu, NavMenu},
      data() {
        return {
          circleUrl: "https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png",
          sizeList: ["large", "medium", "small"],

          showname:JSON.parse(window.sessionStorage.getItem('iflogin')), //判断登录
          loginname:window.sessionStorage.getItem('username'),

          messagelist:[]

        }

      },
      created () {
        this.getTeacherinfo()
      },
      methods: {
         getTeacherinfo() {
          this.$axios.get( "/getAllInfo").then(resp =>{
            console.log(resp.data);
            this.messagelist = resp.data
          })

        },
        listByCategory () {
        var _this = this
        var cid = this.$refs.sideMenu.cid
        console.log(cid)
        var url = 'categories/' + cid + '/teacher'
        this.$axios.get(url).then(resp => {
          console.log(1)
            _this.messagelist = resp.data

        })
      }
      }
    }
</script>

<style scoped>

</style>
